Skip to content

Deleting a user which has an unreviewed first kb article revision will delete the entire kb article even if the follow up revisions were reviewed #2262

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
emilghittasv opened this issue Mar 18, 2025 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@emilghittasv
Copy link
Collaborator

Preconditions
Sign in to SUMO

Steps to reproduce
Steps to reproduce the behavior:

  1. Go to https://support.allizom.org/en-US/kb/new.
  2. Proceed with creating a new kb article and do not approve the first revision.
  3. Create a new revision (with the same user or with a different one).
  4. Approve the revision from step 3.
  5. Delete the user from the preconditions.

Expected behavior
The first revision is dropped (since it was unreviewed) but the reviewed ones are kept.

Actual behavior
The entire kb article is deleted.

Desktop:

  • OS: Windows 11
  • Browser: Firefox

Additional context
This issue is reproducible in stage.

@emilghittasv emilghittasv added the bug Something isn't working label Mar 18, 2025
@github-project-automation github-project-automation bot moved this to ❓ triage in Mozilla Support Mar 18, 2025
@emilghittasv emilghittasv moved this from ❓ triage to 🗄 backlog in Mozilla Support Mar 18, 2025
@escattone escattone self-assigned this Mar 18, 2025
@escattone escattone moved this from 🗄 backlog to 🚀 in progress in Mozilla Support Mar 18, 2025
@akatsoulas
Copy link
Collaborator

@escattone by the time I realized that you have taken this issue, I had opened the PR. My apologies. Feel free to review or discard
mozilla/kitsune#6574

@escattone
Copy link
Contributor

Here's what is happening:

  • User1 first creates an un-approved revision for a fresh document. It's essential that this un-approved revision is created first, because it becomes the based_on for the next step.
  • User2 creates an approved revision. This revision's based_on gets assigned to the un-approved revision of the first step above.
  • User1 is deleted.
  • This line is fine. It's this line that triggers the cascade of deletes that eventually deletes the document itself:
    • The unapproved revision is deleted.
    • Because the based_on of the approved revision is set to the unapproved revision, and because the on_delete is set to cascade, the approved revision is also deleted.
    • Because the current_revision of the document is set to the approved revision, and because the on_delete is set to cascade, the document is deleted.

@emilghittasv
Copy link
Collaborator Author

I can confirm that this issue is verified fixed in stage.

I'm moving this ticket inside the release column.

@emilghittasv emilghittasv moved this from 🔎 QA to 🚢 release in Mozilla Support Mar 31, 2025
@github-project-automation github-project-automation bot moved this from 🚢 release to ✔ done in Mozilla Support Apr 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

No branches or pull requests

3 participants